package com.yu.waterstation.system.modules.system.service;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yu.waterstation.system.modules.system.mapper.LoginLogMapper;
import com.yu.waterstation.common.entity.system.LoginLog;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

@Slf4j
@Service
public class LoginLogService   {

    @Resource
    private LoginLogMapper loginLogMapper;


    public Page<LoginLog> getLoginLogByPage(int pageNo, int pageSize)   {
        return loginLogMapper.selectPage(new Page<>(pageNo, pageSize),
                new QueryWrapper<LoginLog>().orderByDesc("timestamp"));
    }
}
